﻿using System.Web.Routing;
//using RouteDebug;
using Zavand.Web.Mvc.Manana.SampleWebsite.Common.ExternalRoutes;
using Zavand.Web.Mvc.Manana.SampleWebsite.Controllers;
using Zavand.Web.Mvc.Manana.Framework;
using Zavand.Web.Mvc.Manana.SampleWebsite.Common;

namespace Zavand.Web.Mvc.Manana.SampleWebsite
{
    public class MvcApplication : BaseApplication
    {
        public MvcApplication()
        {
            IsLocalizationSupported = true;
        }
        protected void Application_Start()
        {
            ApplicationStart();
            var s = new MockStorage();
            s.Init();

            #region DEBUG

//                        RouteTable.Routes.RouteExistingFiles = false;
//                        RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);

            #endregion
        }
        public override void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute<Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Index.Route>(IsLocalizationSupported);
            routes.MapRoute<Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Post.Route>(IsLocalizationSupported);
            routes.MapRoute<CustomExternalDifferentPortRoute>(IsLocalizationSupported);
            routes.MapRoute<CustomExternalRoute>(IsLocalizationSupported);
            routes.MapRoute<Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Post.CustomRoute>(IsLocalizationSupported);
            routes.MapRoute<IndexRoute>(IsLocalizationSupported);

            base.RegisterRoutes(routes);
        }
    }
}